home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / cfcollection.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  2.3 KB  |  80 lines

  1. <!--- this example shows the basic functionality
  2. of the CFCOLLECTION tag (create, repair, optimize,
  3. delete). --->
  4.  
  5. <HTML>
  6. <HEAD>
  7.     <TITLE>CFCOLLECTION</TITLE>
  8. </HEAD>
  9.  
  10. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  11. <BODY  bgcolor="#FFFFD5">
  12.  
  13. <H3>CFCOLLECTION</h3>
  14. <P>The is a read-only example. Because accessing a collection is
  15. a sensitive area, consider the security of your collection
  16. prior to allowing any form of access to it. </P>
  17. <!--
  18. <!--- Check for server platform --->
  19. <!--- You may need to change this value. --->
  20. <CFIF Server.OS.Name EQ "Windows NT">
  21.   <CFSET collPath = "C:\CFUSION\Verity\Collections\">
  22. <CFELSE>
  23.   <CFSET collpath = "/opt/coldfusion/verity/collections/">
  24. </CFIF>
  25.  
  26. <!--- see if a collection name has been
  27. specified ... --->
  28. <CFIF IsDefined("form.CollectionName") AND
  29. IsDefined("form.CollectionAction")>
  30.  
  31.     <CFIF form.CollectionName is not "">
  32.         <CFOUTPUT>
  33.         <CFSWITCH EXPRESSION=#FORM.CollectionAction#>
  34.           <CFCASE VALUE="Create">
  35.             <CFCOLLECTION ACTION="CREATE"
  36.              COLLECTION="#FORM.CollectionName#"
  37.              PATH="#collPath#">
  38.             <H3>Collection created. Use CFINDEX to populate it.</H3>
  39.           </CFCASE>
  40.           <CFCASE VALUE="Repair">
  41.             <CFCOLLECTION ACTION="REPAIR"
  42.              COLLECTION="#FORM.CollectionName#">
  43.             <H3>Collection repaired.</H3>
  44.           </CFCASE>
  45.           <CFCASE VALUE="Optimize">
  46.             <CFCOLLECTION ACTION="OPTIMIZE"
  47.              COLLECTION="#FORM.CollectionName#">
  48.             <H3>Collection optimized.</H3>
  49.           </CFCASE>
  50.           <CFCASE VALUE="Delete">
  51.             <CFCOLLECTION ACTION="DELETE"
  52.              COLLECTION="#FORM.CollectionName#">
  53.            <H3>Collection deleted.</H3>
  54.           </CFCASE>
  55.         </CFSWITCH>
  56.         </CFOUTPUT>
  57.     <CFELSE>
  58.     <H3>Please enter a name for your collection</H3>    
  59.     </CFIF>
  60. </CFIF>
  61.  
  62. <!--- Make the form to specify the collection name
  63. and action --->
  64.  
  65. <FORM ACTION="cfcollection.cfm" METHOD="POST">
  66. <SELECT NAME="CollectionAction">
  67.     <OPTION value="Create">Create this collection
  68.     <OPTION value="Optimize">Optimize this collection
  69.     <OPTION value="Repair">Repair this collection
  70.     <OPTION value="Delete">Delete this collection
  71. </SELECT>
  72.  
  73. <P>Collection upon which to act (snippets)
  74. <BR><INPUT TYPE="Text" NAME="CollectionName" VALUE="snippets">
  75.  
  76. <INPUT TYPE="Submit" NAME="" VALUE="alter or create my collection">
  77. </FORM>
  78.  -->
  79. </BODY>
  80. </HTML>